/*
 * @Author: lixiaowei
 * @Date: 2021-04-01 22:23:35
 * @LastEditors: lixiaowei
 * @LastEditTime: 2021-04-01 22:36:17
 * @Description: file content
 * @FilePath: /heima-bli/数组/vector.cpp
 */
#include <iostream>
#include <vector>

using namespace std;

int main()
{
  int a[] = {1, 2, 3, 4};

  vector<int> vec(a, a + 4);

  cout << "size is " << vec.size() << endl;
  cout << "capacity is " << vec.capacity() << endl;

  for (int index = 0; index < vec.size(); ++index)
  {
    cout << vec[index] << endl;
  }

  vec.push_back(5);

  cout << "size is " << vec.size() << endl;
  cout << "capacity is " << vec.capacity() << endl;

  for (int index = 0; index < vec.size(); ++index)
  {
    cout << vec[index] << endl;
  }

  return 0;
}